inherited frmChoiceBatch: TfrmChoiceBatch
  Left = 248
  Top = 204
  Caption = #36873#25321#25209#27425
  ClientHeight = 469
  ClientWidth = 809
  ExplicitWidth = 815
  ExplicitHeight = 494
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlBottom: TPanel
    Top = 407
    Width = 809
    Height = 62
    TabOrder = 2
    ExplicitTop = 407
    ExplicitWidth = 809
    ExplicitHeight = 62
    inherited btnOK: TcxButton
      Left = 640
      Top = 14
      TabOrder = 1
      OnClick = btnOKClick
      ExplicitLeft = 640
      ExplicitTop = 14
    end
    inherited btnCancel: TcxButton
      Left = 725
      Top = 14
      TabOrder = 2
      ExplicitLeft = 725
      ExplicitTop = 14
    end
    object btnFilter: TcxButton
      Left = 166
      Top = 14
      Width = 75
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #36807#28388
      TabOrder = 0
      OnClick = btnFilterClick
    end
    object cxLabel1: TcxLabel
      Left = 6
      Top = 18
      Caption = #26597#25214
      Transparent = True
    end
    object cmbChoiceBatch: TcxComboBox
      Left = 38
      Top = 16
      Properties.OnChange = cxComboBox1PropertiesChange
      TabOrder = 3
      Width = 121
    end
    object edtIndustryDepotInfo: TcxComboBox
      Left = 340
      Top = 16
      Anchors = [akLeft, akTop, akRight]
      Properties.ImmediatePost = True
      Properties.OnValidate = edtIndustryDepotInfoPropertiesValidate
      TabOrder = 5
      Visible = False
      Width = 261
    end
    object cxLabel4: TcxLabel
      Left = 280
      Top = 18
      Caption = #34892#19994#24211#23384
      Transparent = True
      Visible = False
    end
  end
  object pnlTop: TPanel
    Left = 0
    Top = 0
    Width = 809
    Height = 41
    Align = alTop
    BevelOuter = bvNone
    TabOrder = 0
    Visible = False
    object edtSDate: TcxDateEdit
      Left = 68
      Top = 16
      TabOrder = 1
      Width = 121
    end
    object edtEDate: TcxDateEdit
      Left = 217
      Top = 16
      TabOrder = 2
      Width = 121
    end
    object cxLabel2: TcxLabel
      Left = 8
      Top = 18
      Caption = #36215#22987#26085#26399
      Transparent = True
    end
    object cxLabel3: TcxLabel
      Left = 196
      Top = 18
      Caption = #33267
      Transparent = True
    end
    object cxButton1: TcxButton
      Left = 347
      Top = 13
      Width = 75
      Height = 25
      Caption = #26597#35810
      TabOrder = 0
      OnClick = cxButton1Click
    end
  end
  object pnlGrd: TPanel
    Left = 0
    Top = 41
    Width = 809
    Height = 366
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 1
    object grdChoiceBatch: TcxGrid
      Left = 8
      Top = 7
      Width = 791
      Height = 369
      TabOrder = 0
      object viewChoiceBatch: TcxGridDBTableView
        Navigator.Buttons.CustomButtons = <>
        DataController.DataModeController.GridMode = True
        DataController.DataSource = dsChoiceBatch
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <>
        DataController.Summary.SummaryGroups = <>
        OptionsBehavior.FocusCellOnTab = True
        OptionsBehavior.GoToNextCellOnEnter = True
        OptionsBehavior.FocusCellOnCycle = True
        OptionsData.CancelOnExit = False
        OptionsData.Deleting = False
        OptionsData.DeletingConfirmation = False
        OptionsData.Editing = False
        OptionsData.Inserting = False
        OptionsView.ColumnAutoWidth = True
        OptionsView.GroupByBox = False
        Styles.Background = MainDM.bslBackGroup
        Styles.ContentEven = MainDM.bsEven
        Styles.ContentOdd = MainDM.bsOdd
        Styles.Header = MainDM.bsTitle
        Styles.Selection = MainDM.bsSelect
        object viewChoiceBatchbname: TcxGridDBColumn
          DataBinding.FieldName = 'bname'
          HeaderAlignmentHorz = taCenter
          Width = 82
        end
        object viewChoiceBatchunitname: TcxGridDBColumn
          DataBinding.FieldName = 'unitname'
          HeaderAlignmentHorz = taCenter
          Width = 40
        end
        object viewChoiceBatchPrice: TcxGridDBColumn
          DataBinding.FieldName = 'Price'
          HeaderAlignmentHorz = taCenter
          Width = 63
        end
        object viewChoiceBatchBatchCode: TcxGridDBColumn
          DataBinding.FieldName = 'BatchCode'
          HeaderAlignmentHorz = taCenter
          Width = 111
        end
        object viewChoiceBatchValidDate: TcxGridDBColumn
          DataBinding.FieldName = 'ValidDate'
          HeaderAlignmentHorz = taCenter
          Width = 83
        end
        object viewChoiceBatchBCode: TcxGridDBColumn
          DataBinding.FieldName = 'BCode'
          HeaderAlignmentHorz = taCenter
          Width = 115
        end
        object viewChoiceBatchBDate: TcxGridDBColumn
          DataBinding.FieldName = 'BDate'
          HeaderAlignmentHorz = taCenter
          Width = 103
        end
        object viewChoiceBatchdepotname: TcxGridDBColumn
          DataBinding.FieldName = 'depotname'
          HeaderAlignmentHorz = taCenter
          Width = 62
        end
        object viewChoiceBatchrelationqty: TcxGridDBColumn
          DataBinding.FieldName = 'relationqty'
          HeaderAlignmentHorz = taCenter
          Width = 68
        end
        object viewChoiceBatchLeftQty: TcxGridDBColumn
          DataBinding.FieldName = 'LeftQty'
          HeaderAlignmentHorz = taCenter
          Width = 62
        end
        object viewChoiceBatchassqty: TcxGridDBColumn
          DataBinding.FieldName = 'assqty'
          HeaderAlignmentHorz = taCenter
          Width = 60
        end
        object viewChoiceBatchquantity: TcxGridDBColumn
          DataBinding.FieldName = 'quantity'
          Visible = False
          HeaderAlignmentHorz = taCenter
        end
        object viewChoiceBatchcustom1: TcxGridDBColumn
          DataBinding.FieldName = 'custom1'
          Visible = False
          HeaderAlignmentHorz = taCenter
          Width = 100
        end
        object viewChoiceBatchcustom2: TcxGridDBColumn
          DataBinding.FieldName = 'custom2'
          Visible = False
          HeaderAlignmentHorz = taCenter
          Width = 100
        end
        object viewChoiceBatchcustom3: TcxGridDBColumn
          DataBinding.FieldName = 'custom3'
          Visible = False
          HeaderAlignmentHorz = taCenter
          Width = 100
        end
        object viewChoiceBatchlength: TcxGridDBColumn
          Caption = #38271
          DataBinding.FieldName = 'Length'
          Visible = False
          Width = 50
        end
        object viewChoiceBatchwidth: TcxGridDBColumn
          Caption = #23485
          DataBinding.FieldName = 'width'
          Visible = False
          Width = 50
        end
        object viewChoiceBatchheight: TcxGridDBColumn
          Caption = #39640
          DataBinding.FieldName = 'height'
          Visible = False
          Width = 50
        end
      end
      object lvlChoiceBatch: TcxGridLevel
        GridView = viewChoiceBatch
      end
    end
  end
  object qryChoiceBatch: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      
        'Select d.productID,d.unitid,u.rate,u.unitname,d.BatchCode,d.Vali' +
        'dDate,d.Btype,d.BID,'
      
        'd.BNo,d.BDate,d.BCode,d.TID,round(d.bprice*u.rate,8) as Price,d.' +
        'bprice,round(d.brelationQty/u.Rate, 8) as relationqty,'
      'd.assqty-d.brelationassqty as assqty,'
      
        'round(d.IOFlag*d.bquantity-d.brelationQty,8)/u.Rate as LeftQty, ' +
        'd.quantity, '
      'd.depotid, st.name as depotname, st.code as depotcode,'
      'b.bname, d.relationpID, d.PRODUCTDATE,'
      'd.custom1,d.custom2,d.custom3,d.length,d.width,d.height'
      'from tt_bill d'
      'left join td_depot st on d.depotid=st.depotid'
      'left join ts_Billset b on b.BID=d.btype'
      
        'left join td_Unitprice u on (d.productid=u.productid and u.uniti' +
        'd=:unitid)'
      'where d.bstate=1 and d.BatchCode is not null'
      
        'and ((d.IOFlag*d.bquantity-d.brelationQty)>0 or 0=:IsReturn) --a' +
        'nd d.relationpid is null'#37319#36141#36864#36135#21487#20197#24341#29992#38144#21806#36864#36135
      
        'and convert(varchar(30), bdate, 23)<=:BDate and d.productid=:pro' +
        'ductid and (st.filid=:filid or 1=:filtrader)')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 564
    Top = 80
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'unitid'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'IsReturn'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'BDate'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'productid'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'filid'
        Value = nil
      end
      item
        DataType = ftUnknown
        Name = 'filtrader'
        Value = nil
      end>
    object qryChoiceBatchproductID: TIntegerField
      FieldName = 'productID'
    end
    object qryChoiceBatchunitid: TIntegerField
      FieldName = 'unitid'
    end
    object qryChoiceBatchrate: TFloatField
      FieldName = 'rate'
    end
    object qryChoiceBatchunitname: TWideStringField
      DisplayLabel = #21333#20301
      FieldName = 'unitname'
      Size = 30
    end
    object qryChoiceBatchBatchCode: TStringField
      DisplayLabel = #25209#21495
      FieldName = 'BatchCode'
      Size = 200
    end
    object qryChoiceBatchValidDate: TDateTimeField
      DisplayLabel = #26377#25928#26399
      FieldName = 'ValidDate'
    end
    object qryChoiceBatchBtype: TIntegerField
      FieldName = 'Btype'
    end
    object qryChoiceBatchBID: TIntegerField
      FieldName = 'BID'
    end
    object qryChoiceBatchBNo: TIntegerField
      FieldName = 'BNo'
    end
    object qryChoiceBatchBDate: TDateTimeField
      DisplayLabel = #21333#25454#26085#26399
      FieldName = 'BDate'
    end
    object qryChoiceBatchBCode: TStringField
      DisplayLabel = #21333#21495
      FieldName = 'BCode'
      Size = 30
    end
    object qryChoiceBatchTID: TIntegerField
      FieldName = 'TID'
    end
    object qryChoiceBatchPrice: TFloatField
      DisplayLabel = #21333#20215
      FieldName = 'Price'
      ReadOnly = True
    end
    object qryChoiceBatchbprice: TFloatField
      DisplayLabel = #22522#26412#21333#20301#21333#25454
      FieldName = 'bprice'
    end
    object qryChoiceBatchrelationqty: TFloatField
      DisplayLabel = #34987#24341#29992#25968#37327
      FieldName = 'relationqty'
      ReadOnly = True
    end
    object qryChoiceBatchLeftQty: TFloatField
      DisplayLabel = #21487#29992#25968#37327
      FieldName = 'LeftQty'
      ReadOnly = True
    end
    object qryChoiceBatchdepotid: TIntegerField
      FieldName = 'depotid'
    end
    object qryChoiceBatchdepotname: TWideStringField
      DisplayLabel = #20179#24211
      FieldName = 'depotname'
      Size = 60
    end
    object qryChoiceBatchdepotcode: TStringField
      FieldName = 'depotcode'
      Size = 30
    end
    object qryChoiceBatchbname: TStringField
      DisplayLabel = #21333#25454#21517#31216
      FieldName = 'bname'
      Size = 50
    end
    object qryChoiceBatchrelationpID: TIntegerField
      FieldName = 'relationpID'
    end
    object qryChoiceBatchPRODUCTDATE: TDateTimeField
      FieldName = 'PRODUCTDATE'
    end
    object qryChoiceBatchquantity: TFloatField
      DisplayLabel = #39046#29992#25968#37327
      FieldName = 'quantity'
    end
    object qryChoiceBatchcustom1: TStringField
      FieldName = 'custom1'
      Size = 200
    end
    object qryChoiceBatchcustom2: TStringField
      FieldName = 'custom2'
      Size = 200
    end
    object qryChoiceBatchcustom3: TStringField
      FieldName = 'custom3'
      Size = 200
    end
    object qryChoiceBatchassqty: TFloatField
      DisplayLabel = #36741#21161#25968#37327
      FieldName = 'assqty'
    end
    object qryChoiceBatchlength: TFloatField
      FieldName = 'length'
    end
    object qryChoiceBatchwidth: TFloatField
      FieldName = 'width'
    end
    object qryChoiceBatchheight: TFloatField
      FieldName = 'height'
    end
  end
  object dsChoiceBatch: TDataSource
    DataSet = qryChoiceBatch
    Left = 564
    Top = 124
  end
end
